var _locationSO = null;

function getDeviceLocation(_callback)
{
	var criteria = new Object();
	
	if(_locationSO == null)
	{
		_locationSO = device.getServiceObject("Service.Location", "ILocation");
	}
	
	criteria.LocationInformationClass = 'BasicLocationInformation';
	
	var self = this;
	
	try
	{
		_locationSO.ILocation.GetLocation(criteria, function(transId, eventCode, result)
		{
			getDeviceLocationCallback(transId, eventCode, result, _callback);
		});
	}
	catch(e)
	{
		//alert(e);
		
		_callback(null, null, null, true);
	}
}
function getDeviceLocationCallback(transId, eventCode, result, _callback)
{
	if(eventCode != 4)
	{
		_callback(result.ReturnValue, result.ErrorCode, result.ErrorMessage)
	}
	else if(eventCode == 4)
	{
		_callback(null, -1, "Generic error");
	}
	else
	{
	}
}